3.282 \(\int \frac{\cos ^2(c+d x) (a B+b B \cos (c+d x))}{a+b \cos (c+d x)} \, dx\)

Optimal. Leaf size=27 \[ \frac{B \sin (c+d x) \cos (c+d x)}{2 d}+\frac{B x}{2} \]

[Out]

(B*x)/2 + (B*Cos[c + d*x]*Sin[c + d*x])/(2*d)

________________________________________________________________________________________

Rubi [A]  time = 0.0145795, antiderivative size = 27, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 3, integrand size = 34, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.088, Rules used = {21, 2635, 8} \[ \frac{B \sin (c+d x) \cos (c+d x)}{2 d}+\frac{B x}{2} \]

Antiderivative was successfully verified.

[In]

Int[(Cos[c + d*x]^2*(a*B + b*B*Cos[c + d*x]))/(a + b*Cos[c + d*x]),x]

[Out]

(B*x)/2 + (B*Cos[c + d*x]*Sin[c + d*x])/(2*d)

Rule 21

Int[(u_.)*((a_) + (b_.)*(v_))^(m_.)*((c_) + (d_.)*(v_))^(n_.), x_Symbol] :> Dist[(b/d)^m, Int[u*(c + d*v)^(m +
 n), x], x] /; FreeQ[{a, b, c, d, n}, x] && EqQ[b*c - a*d, 0] && IntegerQ[m] && ( !IntegerQ[n] || SimplerQ[c +
 d*x, a + b*x])

Rule 2635

Int[((b_.)*sin[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> -Simp[(b*Cos[c + d*x]*(b*Sin[c + d*x])^(n - 1))/(d*n),
x] + Dist[(b^2*(n - 1))/n, Int[(b*Sin[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n, 1] && Integer
Q[2*n]

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rubi steps

\begin{align*} \int \frac{\cos ^2(c+d x) (a B+b B \cos (c+d x))}{a+b \cos (c+d x)} \, dx &=B \int \cos ^2(c+d x) \, dx\\ &=\frac{B \cos (c+d x) \sin (c+d x)}{2 d}+\frac{1}{2} B \int 1 \, dx\\ &=\frac{B x}{2}+\frac{B \cos (c+d x) \sin (c+d x)}{2 d}\\ \end{align*}

Mathematica [A]  time = 0.0201968, size = 24, normalized size = 0.89 \[ \frac{B (2 (c+d x)+\sin (2 (c+d x)))}{4 d} \]

Antiderivative was successfully verified.

[In]

Integrate[(Cos[c + d*x]^2*(a*B + b*B*Cos[c + d*x]))/(a + b*Cos[c + d*x]),x]

[Out]

(B*(2*(c + d*x) + Sin[2*(c + d*x)]))/(4*d)

________________________________________________________________________________________

Maple [A]  time = 0.053, size = 28, normalized size = 1. \begin{align*}{\frac{B}{d} \left ({\frac{\cos \left ( dx+c \right ) \sin \left ( dx+c \right ) }{2}}+{\frac{dx}{2}}+{\frac{c}{2}} \right ) } \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(d*x+c)^2*(a*B+b*B*cos(d*x+c))/(a+b*cos(d*x+c)),x)

[Out]

1/d*B*(1/2*cos(d*x+c)*sin(d*x+c)+1/2*d*x+1/2*c)

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)^2*(a*B+b*B*cos(d*x+c))/(a+b*cos(d*x+c)),x, algorithm="maxima")

[Out]

Exception raised: ValueError

________________________________________________________________________________________

Fricas [A]  time = 1.50298, size = 61, normalized size = 2.26 \begin{align*} \frac{B d x + B \cos \left (d x + c\right ) \sin \left (d x + c\right )}{2 \, d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)^2*(a*B+b*B*cos(d*x+c))/(a+b*cos(d*x+c)),x, algorithm="fricas")

[Out]

1/2*(B*d*x + B*cos(d*x + c)*sin(d*x + c))/d

________________________________________________________________________________________

Sympy [A]  time = 1.14062, size = 68, normalized size = 2.52 \begin{align*} \begin{cases} \frac{B x \sin ^{2}{\left (c + d x \right )}}{2} + \frac{B x \cos ^{2}{\left (c + d x \right )}}{2} + \frac{B \sin{\left (c + d x \right )} \cos{\left (c + d x \right )}}{2 d} & \text{for}\: d \neq 0 \\\frac{x \left (B a + B b \cos{\left (c \right )}\right ) \cos ^{2}{\left (c \right )}}{a + b \cos{\left (c \right )}} & \text{otherwise} \end{cases} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)**2*(a*B+b*B*cos(d*x+c))/(a+b*cos(d*x+c)),x)

[Out]

Piecewise((B*x*sin(c + d*x)**2/2 + B*x*cos(c + d*x)**2/2 + B*sin(c + d*x)*cos(c + d*x)/(2*d), Ne(d, 0)), (x*(B
*a + B*b*cos(c))*cos(c)**2/(a + b*cos(c)), True))

________________________________________________________________________________________

Giac [A]  time = 1.5728, size = 45, normalized size = 1.67 \begin{align*} \frac{{\left (d x + c\right )} B + \frac{B \tan \left (d x + c\right )}{\tan \left (d x + c\right )^{2} + 1}}{2 \, d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)^2*(a*B+b*B*cos(d*x+c))/(a+b*cos(d*x+c)),x, algorithm="giac")

[Out]

1/2*((d*x + c)*B + B*tan(d*x + c)/(tan(d*x + c)^2 + 1))/d